package com.lyf.learn.atsgg.spring.transaction;

import com.lyf.learn.atsgg.spring.transaction.dao.AccountDao;
import com.lyf.learn.atsgg.spring.transaction.service.TransferService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Arrays;

/**
 * @AUTHOR LYF
 * @DATE 2022/5/26
 * @VERSION 1.0
 * @DESC
 */
public class MainApp {
    public static void main(String[] args) {
        ApplicationContext context
                =new ClassPathXmlApplicationContext("beans/Transaction.xml");
        System.out.println(Arrays.toString(context.getBeanDefinitionNames()));

//        AccountDao accountDao=context.getBean(AccountDao.class);
//        accountDao.addAccount("李云飞",1);
        TransferService transferService = context.getBean(TransferService.class);
        transferService.transfer("李云飞","史可心",1);

    }
}
